﻿<Window
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:Microsoft_Windows_Themes="clr-namespace:Microsoft.Windows.Themes;assembly=PresentationFramework.Aero" xmlns:ic="clr-namespace:Microsoft.Expression.Interactivity.Core;assembly=Microsoft.Expression.Interactions" x:Class="Visualization.MainWindow"
        Title="Visualization Home" Height="800" Width="1280" WindowStartupLocation="CenterScreen" WindowState="Maximized" ResizeMode="NoResize" WindowStyle="None" Loaded="windowLoaded">
	<Window.Resources>
		<Style x:Key="ButtonFocusVisual">
			<Setter Property="Control.Template">
				<Setter.Value>
					<ControlTemplate>
						<Rectangle Stroke="Black" StrokeDashArray="1 2" StrokeThickness="1" Margin="2" SnapsToDevicePixels="true"/>
					</ControlTemplate>
				</Setter.Value>
			</Setter>
		</Style>
		<LinearGradientBrush x:Key="ButtonNormalBackground" EndPoint="0,1" StartPoint="0,0">
			<GradientStop Color="#F3F3F3" Offset="0"/>
			<GradientStop Color="#EBEBEB" Offset="0.5"/>
			<GradientStop Color="#DDDDDD" Offset="0.5"/>
			<GradientStop Color="#CDCDCD" Offset="1"/>
		</LinearGradientBrush>
		<SolidColorBrush x:Key="ButtonNormalBorder" Color="#FF707070"/>
		<Style x:Key="ButtonStyle1" TargetType="{x:Type Button}">
			<Setter Property="FocusVisualStyle" Value="{StaticResource ButtonFocusVisual}"/>
			<Setter Property="Background" Value="{StaticResource ButtonNormalBackground}"/>
			<Setter Property="BorderBrush" Value="{StaticResource ButtonNormalBorder}"/>
			<Setter Property="BorderThickness" Value="1"/>
			<Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}"/>
			<Setter Property="HorizontalContentAlignment" Value="Center"/>
			<Setter Property="VerticalContentAlignment" Value="Center"/>
			<Setter Property="Padding" Value="1"/>
			<Setter Property="Template">
				<Setter.Value>
					<ControlTemplate TargetType="{x:Type Button}">
						<Microsoft_Windows_Themes:ButtonChrome x:Name="Chrome" SnapsToDevicePixels="true" BorderBrush="{TemplateBinding BorderBrush}" RenderDefaulted="{TemplateBinding IsDefaulted}" RenderMouseOver="{TemplateBinding IsMouseOver}" RenderPressed="{TemplateBinding IsPressed}">
							<ContentPresenter HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Margin="{TemplateBinding Padding}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" RecognizesAccessKey="True"/>
						</Microsoft_Windows_Themes:ButtonChrome>
						<ControlTemplate.Triggers>
							<Trigger Property="IsKeyboardFocused" Value="true">
								<Setter Property="RenderDefaulted" TargetName="Chrome" Value="true"/>
							</Trigger>
							<Trigger Property="ToggleButton.IsChecked" Value="true">
								<Setter Property="RenderPressed" TargetName="Chrome" Value="true"/>
							</Trigger>
							<Trigger Property="IsEnabled" Value="false">
								<Setter Property="Foreground" Value="#ADADAD"/>
							</Trigger>
						</ControlTemplate.Triggers>
					</ControlTemplate>
				</Setter.Value>
			</Setter>
		</Style>
		<Style x:Key="ComboBoxFocusVisual">
			<Setter Property="Control.Template">
				<Setter.Value>
					<ControlTemplate>
						<Rectangle Stroke="Black" StrokeDashArray="1 2" StrokeThickness="1" Margin="4,4,21,4" SnapsToDevicePixels="true"/>
					</ControlTemplate>
				</Setter.Value>
			</Setter>
		</Style>
		<Geometry x:Key="DownArrowGeometry">M 0 0 L 3.5 4 L 7 0 Z</Geometry>
		<Style x:Key="ComboBoxReadonlyToggleButton" TargetType="{x:Type ToggleButton}">
			<Setter Property="OverridesDefaultStyle" Value="true"/>
			<Setter Property="IsTabStop" Value="false"/>
			<Setter Property="Focusable" Value="false"/>
			<Setter Property="ClickMode" Value="Press"/>
			<Setter Property="Template">
				<Setter.Value>
					<ControlTemplate TargetType="{x:Type ToggleButton}">
						<Microsoft_Windows_Themes:ButtonChrome x:Name="Chrome" SnapsToDevicePixels="true" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" RenderMouseOver="{TemplateBinding IsMouseOver}" RenderPressed="{TemplateBinding IsPressed}">
							<Grid HorizontalAlignment="Right" Width="{DynamicResource {x:Static SystemParameters.VerticalScrollBarWidthKey}}">
								<Path x:Name="Arrow" Fill="Black" HorizontalAlignment="Center" Margin="3,1,0,0" VerticalAlignment="Center" Data="{StaticResource DownArrowGeometry}"/>
							</Grid>
						</Microsoft_Windows_Themes:ButtonChrome>
						<ControlTemplate.Triggers>
							<Trigger Property="IsChecked" Value="true">
								<Setter Property="RenderPressed" TargetName="Chrome" Value="true"/>
							</Trigger>
							<Trigger Property="IsEnabled" Value="false">
								<Setter Property="Fill" TargetName="Arrow" Value="#AFAFAF"/>
							</Trigger>
						</ControlTemplate.Triggers>
					</ControlTemplate>
				</Setter.Value>
			</Setter>
		</Style>
		<LinearGradientBrush x:Key="TextBoxBorder" EndPoint="0,20" StartPoint="0,0" MappingMode="Absolute">
			<GradientStop Color="#ABADB3" Offset="0.05"/>
			<GradientStop Color="#E2E3EA" Offset="0.07"/>
			<GradientStop Color="#E3E9EF" Offset="1"/>
		</LinearGradientBrush>
		<Style x:Key="ComboBoxEditableTextBox" TargetType="{x:Type TextBox}">
			<Setter Property="OverridesDefaultStyle" Value="true"/>
			<Setter Property="AllowDrop" Value="true"/>
			<Setter Property="MinWidth" Value="0"/>
			<Setter Property="MinHeight" Value="0"/>
			<Setter Property="FocusVisualStyle" Value="{x:Null}"/>
			<Setter Property="Template">
				<Setter.Value>
					<ControlTemplate TargetType="{x:Type TextBox}">
						<ScrollViewer x:Name="PART_ContentHost" Background="Transparent" Focusable="false" HorizontalScrollBarVisibility="Hidden" VerticalScrollBarVisibility="Hidden"/>
					</ControlTemplate>
				</Setter.Value>
			</Setter>
		</Style>
		<Style x:Key="ComboBoxToggleButton" TargetType="{x:Type ToggleButton}">
			<Setter Property="OverridesDefaultStyle" Value="true"/>
			<Setter Property="IsTabStop" Value="false"/>
			<Setter Property="Focusable" Value="false"/>
			<Setter Property="ClickMode" Value="Press"/>
			<Setter Property="Template">
				<Setter.Value>
					<ControlTemplate TargetType="{x:Type ToggleButton}">
						<Microsoft_Windows_Themes:ButtonChrome x:Name="Chrome" Width="{DynamicResource {x:Static SystemParameters.VerticalScrollBarWidthKey}}" SnapsToDevicePixels="true" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" RenderMouseOver="{TemplateBinding IsMouseOver}" RenderPressed="{TemplateBinding IsPressed}" RoundCorners="false">
							<Path x:Name="Arrow" Fill="Black" HorizontalAlignment="Center" Margin="0,1,0,0" VerticalAlignment="Center" Data="{StaticResource DownArrowGeometry}"/>
						</Microsoft_Windows_Themes:ButtonChrome>
						<ControlTemplate.Triggers>
							<Trigger Property="IsChecked" Value="true">
								<Setter Property="RenderPressed" TargetName="Chrome" Value="true"/>
							</Trigger>
							<Trigger Property="IsEnabled" Value="false">
								<Setter Property="Fill" TargetName="Arrow" Value="#AFAFAF"/>
							</Trigger>
						</ControlTemplate.Triggers>
					</ControlTemplate>
				</Setter.Value>
			</Setter>
		</Style>
		<ControlTemplate x:Key="ComboBoxEditableTemplate" TargetType="{x:Type ComboBox}">
			<Grid x:Name="Placement" SnapsToDevicePixels="true">
				<Grid.ColumnDefinitions>
					<ColumnDefinition Width="*"/>
					<ColumnDefinition Width="Auto"/>
				</Grid.ColumnDefinitions>
				<Popup x:Name="PART_Popup" AllowsTransparency="true" IsOpen="{Binding IsDropDownOpen, RelativeSource={RelativeSource TemplatedParent}}" Placement="Bottom" PopupAnimation="{DynamicResource {x:Static SystemParameters.ComboBoxPopupAnimationKey}}" Grid.ColumnSpan="2">
					<Microsoft_Windows_Themes:SystemDropShadowChrome x:Name="Shdw" MaxHeight="{TemplateBinding MaxDropDownHeight}" MinWidth="{Binding ActualWidth, ElementName=Placement}" Color="Transparent">
						<Border x:Name="DropDownBorder" Background="{DynamicResource {x:Static SystemColors.WindowBrushKey}}" BorderBrush="{DynamicResource {x:Static SystemColors.WindowFrameBrushKey}}" BorderThickness="1">
							<ScrollViewer>
								<ItemsPresenter SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" KeyboardNavigation.DirectionalNavigation="Contained"/>
							</ScrollViewer>
						</Border>
					</Microsoft_Windows_Themes:SystemDropShadowChrome>
				</Popup>
				<Microsoft_Windows_Themes:ListBoxChrome x:Name="Border" Grid.ColumnSpan="2" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" RenderFocused="{TemplateBinding IsKeyboardFocusWithin}" RenderMouseOver="{TemplateBinding IsMouseOver}"/>
				<TextBox x:Name="PART_EditableTextBox" Margin="{TemplateBinding Padding}" Style="{StaticResource ComboBoxEditableTextBox}" HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}" IsReadOnly="{Binding IsReadOnly, RelativeSource={RelativeSource TemplatedParent}}"/>
				<ToggleButton Style="{StaticResource ComboBoxToggleButton}" Grid.Column="1" IsChecked="{Binding IsDropDownOpen, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}"/>
			</Grid>
			<ControlTemplate.Triggers>
				<Trigger Property="IsKeyboardFocusWithin" Value="true">
					<Setter Property="Foreground" Value="Black"/>
				</Trigger>
				<Trigger Property="IsDropDownOpen" Value="true">
					<Setter Property="RenderFocused" TargetName="Border" Value="true"/>
				</Trigger>
				<Trigger Property="HasItems" Value="false">
					<Setter Property="Height" TargetName="DropDownBorder" Value="95"/>
				</Trigger>
				<Trigger Property="IsEnabled" Value="false">
					<Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.GrayTextBrushKey}}"/>
					<Setter Property="Background" Value="#FFF4F4F4"/>
				</Trigger>
				<Trigger Property="IsGrouping" Value="true">
					<Setter Property="ScrollViewer.CanContentScroll" Value="false"/>
				</Trigger>
				<Trigger Property="HasDropShadow" SourceName="PART_Popup" Value="true">
					<Setter Property="Margin" TargetName="Shdw" Value="0,0,5,5"/>
					<Setter Property="Color" TargetName="Shdw" Value="#71000000"/>
				</Trigger>
			</ControlTemplate.Triggers>
		</ControlTemplate>
		<Style x:Key="ComboBoxStyle1" TargetType="{x:Type ComboBox}">
			<Setter Property="FocusVisualStyle" Value="{StaticResource ComboBoxFocusVisual}"/>
			<Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.WindowTextBrushKey}}"/>
			<Setter Property="Background" Value="{StaticResource ButtonNormalBackground}"/>
			<Setter Property="BorderBrush" Value="{StaticResource ButtonNormalBorder}"/>
			<Setter Property="BorderThickness" Value="1"/>
			<Setter Property="ScrollViewer.HorizontalScrollBarVisibility" Value="Auto"/>
			<Setter Property="ScrollViewer.VerticalScrollBarVisibility" Value="Auto"/>
			<Setter Property="Padding" Value="4,3"/>
			<Setter Property="Template">
				<Setter.Value>
					<ControlTemplate TargetType="{x:Type ComboBox}">
						<Grid x:Name="MainGrid" SnapsToDevicePixels="true">
							<Grid.ColumnDefinitions>
								<ColumnDefinition Width="*"/>
								<ColumnDefinition MinWidth="{DynamicResource {x:Static SystemParameters.VerticalScrollBarWidthKey}}" Width="0"/>
							</Grid.ColumnDefinitions>
							<Popup x:Name="PART_Popup" Margin="1" AllowsTransparency="true" IsOpen="{Binding IsDropDownOpen, RelativeSource={RelativeSource TemplatedParent}}" Placement="Bottom" PopupAnimation="{DynamicResource {x:Static SystemParameters.ComboBoxPopupAnimationKey}}" Grid.ColumnSpan="2">
								<Microsoft_Windows_Themes:SystemDropShadowChrome x:Name="Shdw" MaxHeight="{TemplateBinding MaxDropDownHeight}" MinWidth="{Binding ActualWidth, ElementName=MainGrid}" Color="Transparent">
									<Border x:Name="DropDownBorder" Background="{DynamicResource {x:Static SystemColors.WindowBrushKey}}" BorderBrush="{DynamicResource {x:Static SystemColors.WindowFrameBrushKey}}" BorderThickness="1">
										<ScrollViewer CanContentScroll="true">
											<ItemsPresenter SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" KeyboardNavigation.DirectionalNavigation="Contained"/>
										</ScrollViewer>
									</Border>
								</Microsoft_Windows_Themes:SystemDropShadowChrome>
							</Popup>
							<ToggleButton Style="{StaticResource ComboBoxReadonlyToggleButton}" BorderBrush="{TemplateBinding BorderBrush}" Grid.ColumnSpan="2" IsChecked="{Binding IsDropDownOpen, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}"/>
							<ContentPresenter HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Margin="8,8,0,0" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" IsHitTestVisible="false" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" Content="{TemplateBinding SelectionBoxItem}" ContentStringFormat="{TemplateBinding SelectionBoxItemStringFormat}" ContentTemplate="{TemplateBinding SelectionBoxItemTemplate}" ContentTemplateSelector="{TemplateBinding ItemTemplateSelector}"/>
						</Grid>
						<ControlTemplate.Triggers>
							<Trigger Property="HasDropShadow" SourceName="PART_Popup" Value="true">
								<Setter Property="Margin" TargetName="Shdw" Value="0,0,5,5"/>
								<Setter Property="Color" TargetName="Shdw" Value="#71000000"/>
							</Trigger>
							<Trigger Property="HasItems" Value="false">
								<Setter Property="Height" TargetName="DropDownBorder" Value="95"/>
							</Trigger>
							<Trigger Property="IsEnabled" Value="false">
								<Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.GrayTextBrushKey}}"/>
								<Setter Property="Background" Value="#FFF4F4F4"/>
							</Trigger>
							<Trigger Property="IsGrouping" Value="true">
								<Setter Property="ScrollViewer.CanContentScroll" Value="false"/>
							</Trigger>
						</ControlTemplate.Triggers>
					</ControlTemplate>
				</Setter.Value>
			</Setter>
			<Style.Triggers>
				<Trigger Property="IsEditable" Value="true">
					<Setter Property="BorderBrush" Value="{StaticResource TextBoxBorder}"/>
					<Setter Property="Background" Value="{DynamicResource {x:Static SystemColors.WindowBrushKey}}"/>
					<Setter Property="IsTabStop" Value="false"/>
					<Setter Property="Padding" Value="3"/>
					<Setter Property="Template" Value="{StaticResource ComboBoxEditableTemplate}"/>
				</Trigger>
			</Style.Triggers>
		</Style>
	</Window.Resources>
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="75*" />
            <RowDefinition Height="650*" />
            <RowDefinition Height="75*" />
        </Grid.RowDefinitions>
        <Canvas HorizontalAlignment="Left" x:Name="canvas1" Width="1258" >
            <Label Content="filter visualization" FontFamily="Zegoe UI Light" FontSize="48" Canvas.Left="444" Canvas.Top="8" Foreground="Black"/>
        </Canvas> 
        <Canvas Height="75" HorizontalAlignment="Left" x:Name="canvas2" VerticalAlignment="Top" Width="1258" Grid.Row="2" >
        	<ProgressBar x:Name="progress" Width="940" Height="40" Canvas.Left="158" Canvas.Top="8"/>
        </Canvas>
    	<Canvas x:Name="mainCanvas" Margin="0,0.001,0,0" Grid.Row="1">
    		<Button x:Name="button" Style="{DynamicResource ButtonStyle1}" Width="314" Height="240" Canvas.Left="112" Canvas.Top="170.562" IsEnabled="False">
    			<Image x:Name="image" Width="310.575" Height="202" Source="monitor.png" IsEnabled="False"/>
    		</Button>
    		<Button Width="314" Height="240" Canvas.Left="460" Canvas.Top="170.562" Style="{DynamicResource ButtonStyle1}" IsEnabled="False">
    			<Image x:Name="image2" Width="311.05" Height="202.309" Source="monitor.png"/>
    		</Button>
    		<Button Width="314" Height="240" Canvas.Left="814" Canvas.Top="170.562" Style="{DynamicResource ButtonStyle1}" IsEnabled="False">
    			<Image x:Name="image3" Width="313.2" Height="203.707" Source="monitor.png"/>
    		</Button>
    		<Label x:Name="monitor1Text" Width="314" Height="42" Content="monitor:" Canvas.Left="112" Canvas.Top="124.562" FontSize="26.667" FontFamily="Zegoe UI Light" Foreground="Black"/>
    		<Label x:Name="monitor2Text" Width="314" Height="42" Content="monitor:" FontFamily="Zegoe UI Light" FontSize="26.667" Canvas.Left="460" Canvas.Top="124.562" Foreground="Black"/>
    		<Label x:Name="monitor3Text" Width="314" Height="42" Content="monitor:" FontFamily="Zegoe UI Light" FontSize="26.667" Canvas.Left="814" Canvas.Top="124.562" Foreground="Black"/>
    		<ComboBox x:Name="comboBox1" Style="{DynamicResource ComboBoxStyle1}" Width="314" Height="40" FontSize="16" SelectedIndex="0" Canvas.Left="112" Canvas.Top="414.562" FontFamily="Zegoe UI Light" Foreground="Black">
    			<ComboBoxItem Content="Select Visualization Type...." FontSize="16"/>
    			<ComboBoxItem ToolTip="Shows distribution of x, y, and theta against probability and SFP proposed solution as well as the density of particles" Content="Particle Distribution Visualization"/>
    			<ComboBoxItem ToolTip="Shows x, y data of both SFP and raw data to show disagreements between the two solutions. Can be used to compare multiple localization algorithms" Content="SFP vs Raw Data Disagreement Visualization"/>
    			<ComboBoxItem ToolTip="Shows how the proposed solution changes with time. Can be used to analyze multi-modal solutions." Content="SFP Trending Visualization"/>
    		</ComboBox>
    		<ComboBox x:Name="comboBox2" Width="314" Height="40" Canvas.Left="460" Canvas.Top="414.562" Style="{DynamicResource ComboBoxStyle1}" SelectedIndex="0" FontSize="16" IsEnabled="False" FontFamily="Zegoe UI Light" Foreground="Black">
    			<ComboBoxItem Content="Select Visualization Type...." FontSize="16"/>
    			<ComboBoxItem ToolTip="Shows distribution of x, y, and theta against probability and SFP proposed solution as well as the density of particles" Content="Particle Distribution Visualization"/>
    			<ComboBoxItem ToolTip="Shows x, y data of both SFP and raw data to show disagreements between the two solutions. Can be used to compare multiple localization algorithms" Content="SFP vs Raw Data Disagreement Visualization"/>
    			<ComboBoxItem ToolTip="Shows how the proposed solution changes with time. Can be used to analyze multi-modal solutions." Content="SFP Trending Visualization"/>
    		</ComboBox>
    		<ComboBox x:Name="comboBox3" Width="314" Height="40" Canvas.Left="814" Canvas.Top="414.562" Style="{DynamicResource ComboBoxStyle1}" SelectedIndex="0" FontSize="16" IsEnabled="False" FontFamily="Zegoe UI Light" Foreground="Black">
    			<ComboBoxItem Content="Select Visualization Type...." FontSize="16"/>
    			<ComboBoxItem Content="Particle Distribution Visualization" ToolTip="Shows distribution of x, y, and theta against probability and SFP proposed solution as well as the density of particles"/>
    			<ComboBoxItem Content="SFP vs Raw Data Disagreement Visualization" ToolTip="Shows x, y data of both SFP and raw data to show disagreements between the two solutions. Can be used to compare multiple localization algorithms"/>
    			<ComboBoxItem Content="SFP Trending Visualization" ToolTip="Shows how the proposed solution changes with time. Can be used to analyze multi-modal solutions."/>
    		</ComboBox>
    		<Label Width="198" Height="60.563" Content="data sources:" Canvas.Left="112" Canvas.Top="25.999" FontSize="32" FontFamily="Zegoe UI Light" Foreground="Black"/>
    		<Button Width="184" Height="40.001" Content="Add Data Source" Canvas.Left="944" Canvas.Top="36.695" FontSize="21.333" FontFamily="Zegoe UI Light" Style="{DynamicResource ButtonStyle1}" Click="addDataSource" Foreground="Black"/>
    		<Button Width="312" Height="58" Content="Start Visualization" Canvas.Left="462" Canvas.Top="480" FontSize="32" FontFamily="Zegoe UI Light" Style="{DynamicResource ButtonStyle1}" Click="startVisualization" Foreground="Black"/>
    		<Label x:Name="fileSrcs" Width="626" Height="60.563" Content="(none)" Canvas.Left="314" Canvas.Top="25.999" FontSize="32" FontFamily="Segoe UI Light"/>
    		<Label x:Name="warnings" Content="" FontSize="32" FontFamily="Segoe UI Light" HorizontalAlignment="Center" Canvas.Top="589.435" Width="1016" Canvas.Left="112"/>
    		<Button Width="184" Content="Convert CSV" Canvas.Left="944" Canvas.Top="88.562" Height="36" Style="{DynamicResource ButtonStyle1}" FontFamily="Zegoe UI Light" FontSize="21.333" Click="convertCSV" Foreground="Black"/>
    	</Canvas>
    </Grid>
</Window>
